/* 
 * File:   ImageResizer.cpp
 * Author: Guilherme Monteiro
 * 
 */

#include "../headers/ImageResizer.h"

ImageResizer::ImageResizer() {
}

ImageResizer::ImageResizer(const ImageResizer& orig) {
}

ImageResizer::~ImageResizer() {
}

/**
 * Resizes the source image and
 * make a release of the source image.
 * 
 * @param src: source image
 * @param newWidth
 * @param newHeight
 * @return image resized
 */
IplImage* ImageResizer::resize(IplImage* src, int newWidth, int newHeight) {
    
    IplImage* dest = cvCreateImage( cvSize(newWidth, newHeight), src->depth, src->nChannels );
    cvResize(src, dest, CV_INTER_LINEAR);
    
    cvReleaseImage(&src);
    
    return dest;
}